import time

import requests
import app

class AddCart:

    def __init__(self):
        # 购买商品数+1
        self.post_add_cart_url = "https"+app.BASE_URL + "/vega-server/cxfxCart/addCart"

    # 商品+1
    def post_add_cart(self,groupNo,id,saveNum):
        myJson = {"groupNo":groupNo,"cxfxGroupBuyDetailId":id,"saveNum":saveNum}
        myHeads = {"Content-Type": "application/json","token":app.TOKEN}
        return requests.post(url=self.post_add_cart_url,json=myJson,headers=myHeads,verify=False)
if __name__ == '__main__':
    a = AddCart().post_add_cart("T1039001",407,3).json()
    print(a)